import { computed, ref } from "vue";

export const useMask = () => {
  let startX = ref();
  let startY = ref();
  let endX = ref();
  let endY = ref();

  let minX = computed(() => {
    return Math.min(startX.value, endX.value);
  });
  let maxX = computed(() => {
    return Math.max(startX.value, endX.value);
  });
  let minY = computed(() => {
    return Math.min(startY.value, endY.value);
  });
  let maxY = computed(() => {
    return Math.max(startY.value, endY.value);
  });

  return {
    startX,
    startY,
    endX,
    endY,
    minX,
    maxX,
    minY,
    maxY,
  };
};
